using System.Collections.Generic;

namespace MidnightPeach.Engine.Schema.ServiceSchema
{
    public class Class : SchemaElement
    {
        public Class(string name, Assembly assembly, bool forCache, bool forService, bool isDbContext) : base(name)
        {
            Assembly = assembly;

            Methods = new List<Method>();

            ForCache = forCache;
            ForService = forService;
            IsDbContext = isDbContext;
        }

        public Assembly Assembly { get; private set; }

        public List<Method> Methods { get; private set; }

        public bool ForCache { get; set; }
        
        public bool ForService { get; set; }
        
        public bool IsDbContext { get; set; }
        
        public override string PascalName
        {
            // CategoryData -> Category
            get { return ToPascalName(Name.Substring(0, Name.Length - 4)); }
        }

        public override string CamelName
        {
            // CategoryData -> category
            get { return ToCamelName(Name.Substring(0, Name.Length - 4)); }
        }
    }
}
